using System;

using FluentAssertions;

namespace CodeStream.Testing.WebAutomation.UnitTests
{
    public static class UIDefinitionValidationExtensions
    {
        public static void ShouldBe(this UIDefinitionClass control, string typeName, string tag, string id, string cssClass, Type type)
        {
            control.TypeName.Should().Be(typeName);
            control.BaseTypeName.Should().Be(type.Name);
            control.Tag.Should().Be(tag);
            control.Id.Should().Be(id);
            control.CssClass.Should().Be(cssClass);
        }

        public static void ShouldBe(this UIDefinitionField control, string name, string tag, string id, string cssClass, Type type, bool multiple = false)
        {
            control.Name.Should().Be(name);
            control.Tag.Should().Be(tag);
            control.Id.Should().Be(id);
            control.CssClass.Should().Be(cssClass);
            control.TypeName.Should().Be(type.Name);
            control.Multiple.Should().Be(multiple);
            control.IsContainer.Should().BeFalse();
        }

        public static void ShouldBe(this UIDefinitionField control, string name, string tag, string id, string cssClass, string typeName, bool multiple = false)
        {
            control.Name.Should().Be(name);
            control.Tag.Should().Be(tag);
            control.Id.Should().Be(id);
            control.CssClass.Should().Be(cssClass);
            control.TypeName.Should().Be(typeName);
            control.Multiple.Should().Be(multiple);
            control.IsContainer.Should().BeTrue();
        }
    }
}
